package com.eduask.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eduask.beans.TuiPiao;
import com.eduask.dao.TuiPiaoDAO;
import com.eduask.util.HibernateUtil;

@Repository
public class TuiPiaoDAOImpl extends HibernateUtil implements TuiPiaoDAO{

	@Override
	public TuiPiao findTuiPiaoById(Integer id) {
		return getSession().get(TuiPiao.class, id);
	}

	@Override
	public List<TuiPiao> findAllTuiPiao() {
		String hql = "from TuiPiao tuiPiao order by tuiPiao.id asc";
		return getSession().createQuery(hql).list();
	}

}
